package com.xiami.service.impl;

import com.xiami.mapper.DeptMapper;
import com.xiami.pojo.Dept;
import com.xiami.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

/*
创建者:虾米糖
*/
@Service
public class DeptServiceImpl implements DeptService {
    @Autowired
    private DeptMapper deptMapper;
    @Override
    public List<Dept> list(Integer id) {
        deptMapper.list(id);
        return null;
    }

    @Override
    public void addDept(Dept dept) {
        dept.setCreateTime(LocalDateTime.now());
        dept.setUpdateTime(LocalDateTime.now());
        deptMapper.insert(dept);
    }

    @Override
    public List<Dept> list1() {
        List<Dept> deptAll = deptMapper.selectAll();
        return deptAll;
    }
}
